package com.ljfiction.book.activitys;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.ljfiction.book.R;
import com.ljfiction.book.http.HttpManager;
import com.ljfiction.book.tools.SettingManager;
import com.lzy.okhttputils.OkHttpUtils;
import com.lzy.okhttputils.callback.StringCallback;

import org.json.JSONException;
import org.json.JSONObject;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import okhttp3.Call;
import okhttp3.Response;

public class AuthorxieyiActivity extends BaseActivity {

    @BindView(R.id.authorxieyiback)
    ImageView authorxieyiback;
    @BindView(R.id.zuozhexieyi)
    TextView zuozhexieyi;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_authorxieyi);
        ButterKnife.bind(this);
        intData();

    }

    private void intData() {
        OkHttpUtils.get(HttpManager.IP+"/sys-authorAgreement")

                .execute(new StringCallback() {
                    @Override
                    public void onSuccess(String s, Call call, Response response) {
                        try {
                            JSONObject js=new JSONObject(s);
                            if (js.getInt("returnCode")==200){
                                zuozhexieyi.setText(js.getString("data"));
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                    }
                });
    }

    @OnClick(R.id.authorxieyiback)
    public void onViewClicked() {
        goBack();
    }
}
